﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Function.aspx.cs" Inherits="Function"
    MasterPageFile="~/Site.master" %>

<%@ Register Assembly="DevExpress.Web.v10.2.Linq, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxTreeList.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTreeList" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallbackPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="MainContent">
    <h1 class="DemoTitle">
        人员权限分配管理
    </h1>
    <div id="DemoArea">
        <div class="Spacer" style="height: 14px;">
        </div>
        <table runat="server" id="QueryTable">
            <tr>
                <td>
                    <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="人员">
                    </dx:ASPxLabel>
                </td>
                <td>
                    <dx:ASPxComboBox ID="ASPxCmbData" runat="server" ValueType="System.String" ValueField="yhbh"
                        ClientInstanceName="c_user" DataSourceID="cmdDataSource" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                        Font-Size="9pt" DisplayFormatString="{0}" DropDownStyle="DropDown" IncrementalFilteringMode="Contains">
                        <Columns>
                            <dx:ListBoxColumn Caption="用户编码" FieldName="yhbh" />
                            <dx:ListBoxColumn Caption="用户名" FieldName="yhmc" />
                        </Columns>
                        <%--   <ClientSideEvents TextChanged="function(s, e) {QueryTree.PerformCallBack(s.GetValue());}" />--%>
                        <ClientSideEvents TextChanged="function(s,e){QueryTree.PerformCallback(s.GetValue()); }" />
                        <ItemStyle Font-Size="9pt" />
                        <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                        </LoadingPanelImage>
                        <LoadingPanelStyle ImageSpacing="5px">
                        </LoadingPanelStyle>
                        <ButtonStyle Width="13px">
                        </ButtonStyle>
                    </dx:ASPxComboBox>
                </td>
                <td style="padding-left: 5px">
                    <dx:ASPxButton ID="btnSave" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                        CssPostfix="Office2010Blue" Font-Size="10pt" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                        Text="保存" AutoPostBack="False" UseSubmitBehavior="False">
                        <%-- PerformCallback就是从客户端到服务端的桥梁，它是单向的只能从客户端发起到服务端。--%>
                        <ClientSideEvents Click="function(s,e){QueryPanel.PerformCallback(c_user.GetValue()); }" />
                    </dx:ASPxButton>
                </td>
            </tr>
        </table>
        <dx:ASPxCallbackPanel ID="QueryCBPanel" runat="server" Width="100%" OnCallback="QueryCBPanel_Callback"
            ClientInstanceName="QueryPanel">
            <PanelCollection>
                <dx:PanelContent ID="PanelContent1" runat="server" SupportsDisabledAttribute="True">
                    <dx:ASPxTreeList ID="DxTreelist" runat="server" AutoGenerateColumns="False" Width="100%"
                        CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                        OnCustomCallback="DxTreelist_CustomCallback" ClientInstanceName="QueryTree" Font-Size="10pt"
                        KeyFieldName="qxbm" ParentFieldName="sjbm">
                        <%--  在客户端进行Dev控件编程必须为Dev控件指定一个客户端的名称即ClientInstanceName客户端直接根据ClientInstanceName来进行相关的操作--%>
                        <Columns>
                            <dx:TreeListTextColumn Caption="编号" FieldName="qxbm" VisibleIndex="0">
                            </dx:TreeListTextColumn>
                            <dx:TreeListTextColumn Caption="功能" FieldName="qxmc" VisibleIndex="1">
                            </dx:TreeListTextColumn>
                        </Columns>
                        <Settings SuppressOuterGridLines="True" />
                        <SettingsBehavior AllowFocusedNode="True" AutoExpandAllNodes="true" />
                        <SettingsPager>
                            <Summary Text="当前第{0}页，共{1}页，{2}条记录" />
                        </SettingsPager>
                        <SettingsSelection Enabled="True" Recursive="True" />
                        <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                            <LoadingPanel Url="~/App_Themes/Office2010Blue/TreeList/Loading.gif">
                            </LoadingPanel>
                        </Images>
                        <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                            <LoadingPanel ImageSpacing="5px">
                            </LoadingPanel>
                        </Styles>
                        <StylesPager>
                            <PageNumber ForeColor="#3E4846">
                            </PageNumber>
                            <Summary ForeColor="#1E395B">
                            </Summary>
                        </StylesPager>
                        <StylesEditors ButtonEditCellSpacing="0">
                        </StylesEditors>
                    </dx:ASPxTreeList>
                </dx:PanelContent>
            </PanelCollection>
        </dx:ASPxCallbackPanel>
        <asp:SqlDataSource ID="cmdDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:CMSConnectionStrings %>"
            
            SelectCommand="SELECT [yhbh], [yhmc], [qx], [IsAdmin] FROM [css_yhxx] WHERE ([IsAdmin] &lt;&gt; @IsAdmin)">
            <SelectParameters>
                <asp:Parameter DefaultValue="1" Name="IsAdmin" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
</asp:Content>
